﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OmronLib.Base
{
    public class CipErrors
    {
        public static Dictionary<byte, string> HeaderErrors = new Dictionary<byte, string>
        {
            {0x00,"Success" },
            {0x01,"发件人发出了无效或不受支持的封装命令" },
            {0x02,"接收方中的内存资源不足，无法处理该命令。这不是应用程序错误。相反，仅当封装层无法获取所需的内存资源时，才会出现这种情况" },
            {0x03,"封装消息的数据部分中的数据格式不正确或不正确" },
            {0x64,"发起方在向目标发送封装消息时使用无效的会话句柄" },
            {0x65,"目标收到长度无效的消息" },
            {0x69,"不支持的封装协议修订版" },
        };

        public static Dictionary<string, string> RespErrors = new Dictionary<string, string>()
        {
            {"0000","Success" },
            {"0001","Connection failure" },
            {"0002","Resource unavailable" },
            {"0003","Invalid parameter value" },
            {"0004","Path segment error" },
            {"0005","Path destination unknown" },
            {"0006","Partial transfer" },
            {"0007","Connection ID is not valid" },
            {"0008","Service not supported" },
            {"0009","Invalid attribute value" },
            {"000A","Attribute list error" },
            {"000B","Already in requested mode/state" },
            {"000C","Object state conflict" },
            {"000D","Object already exists" },
            {"000E","Attribute not settable" },
            {"000F","Privilege violation" },
            {"0010","Device state conflict" },
            {"0011","Reply data too large" },
            {"0012","Fragmentation of a primitive value" },
            {"0013","Not enough data" },
            {"0014","Attribute not supported" },
            {"0015","Too Much Data" },
            {"0016","Object does not exist" },
            {"0017","Service fragmentation sequence not in progress" },
            {"0018","No stored attribute data" },
            {"0019","Store operation failure" },
            {"001A","Routing failure: request packet too large" },
            {"001B","Routing failure: response packet too large" },
            {"001C","Missing attribute list entry data" },
            {"001D","Invalid attribute value list" },
            {"001E","Embedded service error" },
            {"001F","Vendor specific error" },
            {"0020","Invalid parameter" },
        };
    }
}
